import { defineConfig } from 'vitepress'

export default defineConfig({
  title: 'VisionGroup3 OpenDoc',
  description: 'VisionGroup3视觉软件完整操作文档',
  
  themeConfig: {
    nav: [
      { text: '首页', link: '/' },
      { text: '快速开始', link: '/guide/getting-started' },
      { text: 'API参考', link: '/api/' },
      { text: '示例', link: '/examples/' }
    ],

    sidebar: {
      '/guide/': [
        {
          text: '基础指南',
          items: [
            { text: '安装与配置', link: '/guide/installation' },
            { text: '快速开始', link: '/guide/getting-started' },
            { text: '界面导览', link: '/guide/interface-tour' },
            { text: '项目创建', link: '/guide/project-creation' }
          ]
        },
        {
          text: '功能模块',
          items: [
            { text: '图像采集', link: '/guide/image-acquisition' },
            { text: '预处理', link: '/guide/preprocessing' },
            { text: '特征提取', link: '/guide/feature-extraction' },
            { text: '缺陷检测', link: '/guide/defect-detection' },
            { text: '测量工具', link: '/guide/measurement-tools' },
            { text: '结果输出', link: '/guide/output-results' }
          ]
        },
        {
          text: '高级功能',
          items: [
            { text: '脚本编程', link: '/guide/scripting' },
            { text: '自定义算法', link: '/guide/custom-algorithms' },
            { text: '性能优化', link: '/guide/performance' }
          ]
        }
      ],
      '/api/': [
        {
          text: 'API文档',
          items: [
            { text: '概述', link: '/api/' },
            { text: '图像处理API', link: '/api/image-processing' },
            { text: '工具API', link: '/api/tools' },
            { text: '脚本API', link: '/api/scripting' }
          ]
        }
      ],
      '/examples/': [
        {
          text: '示例项目',
          items: [
            { text: '基础示例', link: '/examples/basic' },
            { text: '缺陷检测案例', link: '/examples/defect-detection' },
            { text: '尺寸测量案例', link: '/examples/measurement' },
            { text: 'OCR识别案例', link: '/examples/ocr' }
          ]
        }
      ]
    },

    socialLinks: [
      { icon: 'github', link: 'https://github.com/visiongroup3/opendoc' }
    ],

    footer: {
      message: 'Released under the MIT License.',
      copyright: 'Copyright © 2024 VisionGroup3 OpenDoc Contributors'
    },

    search: {
      provider: 'local'
    },

    editLink: {
      pattern: 'https://github.com/visiongroup3/opendoc/edit/main/docs/:path',
      text: '在GitHub上编辑此页'
    },

    lastUpdated: {
      text: '最后更新于'
    }
  },

  markdown: {
    theme: {
      light: 'vitesse-light',
      dark: 'vitesse-dark'
    },
    lineNumbers: true
  },

  head: [
    ['link', { rel: 'icon', href: '/favicon.ico' }]
  ]
})
